1. Field of the Invention
The present invention generally relates to a ranging sensor and, more particularly, to a ranging sensor for detecting the distance to the object, and others, by projecting light to the object and receiving the light reflected from the object. The present invention also relates to an electronic device with such a ranging sensor.
2. Description of the Background Art
A ranging sensor applying a so-called triangulation ranging method is applied is known as a device for measuring the distance to an object.
FIG. 8 is a schematic diagram for describing the principle of measurement of distance in a ranging sensor applying such a triangulation ranging method.
Pulse light emitted from a light emitting diode (LED) 101, which is a light emitting element, is converted to a fine beam by means of a projection lens 133 and is projected toward objects 150 and 160. Light reflected from objects 150 and 160 is condensed onto a light receiving surface of a position sensing device (PSD) 102, which is a light receiving element, by means of a condenser lens 138. The PSD is a semiconductor element which detects the position of incident light.
Herein, as shown in FIG. 8, the position (spot position) at which the reflected light has been condensed by means of condenser lens 138 becomes a position which varies in accordance with the distance from the ranging sensor to the object. The light receiving surface of PSD 102 is arranged so as to overlap the range of fluctuation of this position of the condensed light. As a result, a pair of photoelectric power outputs outputted from PSD 102 is processed, thereby measuring the distance to the object.
Herein, it is possible, in addition to a PSD, to use a division-type photodiode or the like having a plurality of light receiving surfaces as a light receiving element.
FIG. 9 is a cross sectional view for describing the structure of a conventional ranging sensor applying the above-described triangulation ranging method.
LED 101, PSD 102 and a control integrated circuit (IC) 103 are mounted on a lead frame 108 by means of die bonding, wire bonding or the like.
These are surrounded by and sealed into light transmitting resin 109. Furthermore, the outside of light transmitting resin 109 is encased in a case 111a made of a light shielding resin. At this time, optical windows for transmitting light are provided on the upper side of case 111a in positions opposite to at least LED 101 and PSD 102. A lens case 111b in which a projection lens 133 and a condenser lens 138 are integrally formed by a light transmitting resin is attached to the upper surface of case 111a. 
FIG. 10 is a circuit configuration diagram of a conventional ranging sensor. A clock pulse having a constant period emitted by an oscillation circuit provided within a signal processing circuit 106 is supplied to a timing oscillation circuit also provided within signal processing circuit 106, so that a drive pulse is generated. This drive pulse is inputted into a light emitting circuit 104, so that LED 101 emits light.
On the other hand, a pair of faint photoelectric current outputs obtained by PSD 102, by sensing the reflected light, is amplified by an amplification circuit 105 and, then, is inputted into signal processing circuit 106. An operation is carried out based on this input signal in signal processing circuit 106, and the result thereof is outputted to the outside via an output circuit 107. Herein, the above-described light emitting circuit 104, amplification circuit 105, signal processing circuit 106 and output circuit 107 are usually integrated into control IC 103 so as to be in one package.
As for the signal processing method, there are an analog output method for outputting information concerning the distance to an object by using the variation in the amount of output in accordance with distance as shown in FIG. 11 and an H/L output method for outputting a high (H) or low (L) pulse in comparison with a preset threshold value.
An error occurs, however, between the actual distance to an object and the output of the ranging sensor in either output method. This error is caused due to (1) variation in assembling position precision of the LED, projection lens, condenser lens and PSD; and (2) variation in element characteristics such as the light emitting characteristics and the light receiving characteristics of the LED and PSD.
In the analog output method, for example, an output characteristic curve C or an output characteristic curve E, shown with dotted line in FIG. 11, can be obtained by the above-described variation with respect to a reference output characteristic curve C shown with solid line in FIG. 11. As described above, an error is caused between the actual distance to the object and the output of the ranging sensor due to the variation in the assembling position precision and the variation in the element characteristics. Similarly, this may be also caused in the H/L output method.
As a method for achieving a reduction of such an error in output, there is a method of actually installing an object after assembling a ranging sensor, performing ranging by using the ranging sensor, and adjusting the resulting output to a proper value.
As shown in FIG. 10, for example, there is a method of providing an external variable resistance 107a previously connected to output circuit 107, and electrically adjusting an output by altering a resistance value R of external variable resister 107a, thereby reducing an error. In the case that this technique is used, however, an additional external circuit becomes necessary and a problem arises wherein the cost of manufacture increases.
In addition, there is a technique wherein no adjustment is carried out in the manufacturing process of a ranging sensor and the output of the ranging sensor is corrected by the user using a microcomputer. This technique, however, is not preferable because the burden to the user is great.
There is another technique wherein the output of a ranging sensor is mechanically adjusted. The ranging sensor shown in FIG. 12 is formed so that the position of PSD 202, which is attached to the upper surface of a lead frame 208, is adjustable. That is to say, electrodes 260 on lead frame 208 to which the terminals of PSD 202 are connected are formed so as to be larger than the electrodes to which the terminals of an LED 201 and the terminals of a control IC 203 are connected. Thereby, it becomes possible to adjust the position wherein PSD 202 is attached to lead frame 208 in the direction of arrow F in the figure while monitoring the output of the ranging sensor. Adjustment of output is carried out according to the above positional adjustment.
However, the position where PSD 202 is attached is determined while the output of the ranging sensor is being monitored according to this technique and a problem arises because of the requirement for this very difficult task.
In the ranging sensor shown in FIG. 13, divided lead frames 308a and 308b are provided so that an LED 301 and a PSD 302 are mounted on the separate lead frames. That is to say, adjustment of the output is carried out by shifting the position of lead frame 308b in the direction of arrow G in the figure while monitoring the output after mounting.
However, it is necessary to utilize flexible wires 370, or the like, in order to secure an electrical connection between divided lead frames 308a and 308b according to this technique and, therefore, the cost of manufacture is increased. In addition, a problem arises wherein the size of the device tends to increase.